package com.example.demo.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.example.demo.dao.RoleMapper;
import com.example.demo.entity.Role;
import com.example.demo.service.IRoleService;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author hanfei
 * @since 2020-04-08
 */
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IRoleService {
        @Resource
        public RoleMapper mapper;

        public RoleMapper getMapper() {
        return mapper;
        }

        public void setMapper(RoleMapper mapper) {
        this.mapper = mapper;
        }

        public Page<Role> findByKey(Page<Role> var1, @Param("key") String key){
        var1.setRecords(mapper.findByKey(var1,key));
        return var1;
        }
        public Page<Role> findByKeyAndAll(Page<Role> var1, @Param("key") String key, Role entity){
        var1.setRecords(mapper.findByKeyAndAll(var1,key,entity));
        return var1;
        }
        }
